package org.example.java_chatroom.model;

import java.io.Serializable;

/**
 * @Author @fiber-cloud
 * @Date 2025/11/2 18:09
 */
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    private int userId;
    private String username = "";
    private String password = "";
    private String securityQuestion;  // 新增密保问题
    private String securityAnswer;    // 新增密保答案


    // 构造方法
    public User() {}

    public User(Integer userId, String username, String password, String securityQuestion, String securityAnswer) {
        this.userId = userId;
        this.username = username;
        this.password = password;
        this.securityQuestion = securityQuestion;
        this.securityAnswer = securityAnswer;
    }

    public String getSecurityQuestion() {
        return securityQuestion;
    }

    public void setSecurityQuestion(String securityQuestion) {
        this.securityQuestion = securityQuestion;
    }

    public String getSecurityAnswer() {
        return securityAnswer;
    }

    public void setSecurityAnswer(String securityAnswer) {
        this.securityAnswer = securityAnswer;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }


    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
